﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ModuleTypes.ascx.cs" Inherits="Administrator_Controls_ModuleTypes" %>
<script type="text/javascript">    
    var index = "";        
        $("input.del").click(function () {
            $("table input[type=checkbox].item").each(function () {
                var checked = $(this).attr("checked");
                if (checked) {
                    index = index + $(this).parent().parent().attr("id") + ";";
                }
            });
            $("#<%=hdfCheck.ClientID%>").val(index);
            if (index == "") return false;
            else return confirm("Bạn có chắc chắn muốn xóa loại module này không?");
        });        
    });
</script>
<asp:HiddenField ID="hdfCheck" runat="server" />
<!-- table -->
<div class="box">
    <!-- box / title -->
    <div class="title">
        <h5 runat="server" id="title">
            Loại Modules</h5>
    </div>
    <div id="divMessage" runat="server">
    </div>
    <div class="first-action">
        <div class="button">
            <a href="default.aspx?control=moduletypesadd">
                <input type="button" value="Thêm Mới" /></a>
        </div>
    </div>
    <!-- end box / title -->
    <div class="table">
        <table id="table-3">
            <thead>
                <tr>
                    <th class="smaller">
                        STT
                    </th>
                    <th>
                        Tiêu đề
                    </th>
                    <th>
                        Mô tả
                    </th>
                    <th>
                        Loại nội dung
                    </th>
                    <th class="small">
                        Chọn nội dung
                    </th>
                    <th class="small">
                        Sửa
                    </th>
                    <th class="selected last">
                        <input type="checkbox" class="checkall" />
                    </th>
                </tr>
            </thead>
            <tbody>
                <asp:Repeater ID="rptData" runat="server">
                    <ItemTemplate>
                        <tr id="<%#Eval("MODULE_TYPE_ID") %>">
                            <td class="right">
                                <%#Container.ItemIndex+1 %>
                            </td>
                            <td class="left">
                                <%#Eval("TYPE_NAME")%>
                            </td>
                            <td class="left">
                                <%#Eval("CONTENT_KEY")%>
                            </td>
                            <td class="left">
                                <%#Eval("TYPE_DESCRIPTION")%>
                            </td>
                            <td>
                                <asp:CheckBox runat="server" ID="cboOption" Checked='<%#Eval("TYPE_OPTION") %>' />
                            </td>
                            <td>
                                <a href="default.aspx?control=moduletypesedit&id=<%#Eval("MODULE_TYPE_ID") %>" class="edit"
                                    title="Chỉnh sửa">&nbsp;&nbsp;&nbsp;</a>
                            </td>
                            <td align="center" class="last">
                                <input id="chkBox" type="checkbox" value='<%#Eval("MODULE_TYPE_ID")%>' class="item"
                                    runat="server" />
                            </td>
                        </tr>
                    </ItemTemplate>
                </asp:Repeater>
            </tbody>
        </table>
        <div class="action">
            <asp:DropDownList ID="ddlAction" runat="server" OnSelectedIndexChanged="ddlAction_SelectedIndexChanged"
                AutoPostBack="true" CssClass="selectwidth">
                <asp:ListItem Value="0" class="folder-open" Text="---Chọn hành động---"></asp:ListItem>
                <asp:ListItem Value="1" class="locked" Text="Di chuyển tới thùng rác"></asp:ListItem>
                <asp:ListItem Value="2" class="unlocked" Text="Xóa vĩnh viễn"></asp:ListItem>
            </asp:DropDownList>
            <div class="button">
                <a href="default.aspx?control=moduletypesadd">
                    <input type="button" value="Thêm Mới" /></a>
            </div>
        </div>
    </div>
</div>
<!-- end table -->
